package j01xiancheng;

public class J3main {
    public static void main(String[] args) {
        //获取当前代码执行的线程实例
        Thread main = Thread.currentThread();
        System.out.println(main);
        System.out.println(main.getName());

        new Thread(){
            @Override
            public void run() {
                Thread tChild = Thread.currentThread();
                System.out.println("i am child-"+tChild.getName());
            }
        }.start();

    }
}
